home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Textfiles / zines / hir / hir3 Folder.sit / hir3 Folder / HIR3-3.TXT < prev    next >
Text File  |  1997-12-29  |  7KB  |  126 lines

  1.  /"-_-"-_-"-_-"-_-"-_-"-_-"-_-"-_-"-_-"-_-"-_-"-_-"-_-"-_-"-_-"-_-"-_-"-_-"\
  2.  \         H A C K E R S   I N F O R M A T I O N   R E P O R T             /
  3.  /                                                                         \
  4.  \               The Joys of The Personal Computer CMOS                       /
  5.   "-_-"-_-"-_-"-_-"-_-"-_-"-_-"-_-"-_-"-_-"-_-"-_-"-_-"-_-"-_-"-_-"-_-"-_-"
  6.                                 By Axon
  7.  
  8. Ahoy!  Axon here.  I Figured it would be a good thing to teach all you guys
  9. a few things about the Personal Computer CMOS (Complimentary Metal Oxide
  10. Semiconductor).  Actually, Complimentary Metal Oxide is what most Integrated
  11. Circuits are made of, however, when one refers to "THE CMOS", they are either
  12. Stupid, or they are talking about the Personal Computer's way of storing
  13. configuration Settings.
  14.  
  15. The CMOS is part of the modern computer's hardware that saves many things,
  16. such as the specifications of your hard drive, what floppy drives you have,
  17. and various other settings like the password used for protected boot-ups.
  18.  
  19. Potentially, this brings up a lot of cool ideas.  I don't know much about the
  20. data format of the CMOS memory, but I know that traditionally in the IBM AT
  21. computers, when the CMOS was introduced, there were 64 bytes of memory on the
  22. chip.
  23.  
  24. Before the CMOS was nothing.  There were jumpers, or switches on the mother-
  25. boards of computers.  These switches PHYSICALLY held setup values such as
  26. what types of floppy drives, and video settings.  There was no password.  A
  27. severe drawback to this system was that in order to change these values, one
  28. needed to pull the case off of the computer, search for the switches, which
  29. were scarcely ever located in a single place.  Usually they were near the
  30. device they affected.  If the switches were jumpers, which they usually were,
  31. you needed small fingers or a pair of tweezers to adjust them.  It was clear
  32. that there must be a better way of doing things.  With a lot of hard thinking
  33. and determination, IBM toyed with the idea of using computer memory to store
  34. the settings that the Jumpers were used for.
  35.  
  36. Memory is volatile.  When you shut off power, the bits that are stored are
  37. hosed, lost forever.  The CMOS is no exception.  All computers with a CMOS
  38. chip also have a battery of some sort that support it while the computer is
  39. off.  These batteries can be NiCd or Lithium.  Disconnecting the battery from
  40. the motherboard will erase all settings the CMOS held (sometimes the battery
  41. needs to stay disconnected for as long as 2 hours for the CMOS data to vapor-
  42. ize.  Also, there is usually a jumper near the CMOS chip.  I will discuss the
  43. battery later, right now I will focus on identifying the chip itself.
  44.  
  45. Usually, the chip has 28 pins. Most of the time it isn't soldered onto the
  46. motherboard, it actually fits in a DIP socket on the board, and looks like
  47. a long sandwich to me.  There will usually be a sticker on the top that says
  48. "AWARD", "Ami, or American MEgatrends", or "Phoenix".  possibly others.  This
  49. is the chip you are concerned with.  Look for a jumper near it (within 1 inch)
  50. For those idiots out there, a jumper is a little black...thing, that is about
  51. 1/8" by 1/4" by 1/4" inch (roughly, I don't have one with me to measure,
  52. unless i take apart the computer i am typing this on.)  It has 2 holes that
  53. will fit over pins on the motherboard.  chances are, only one hole of the
  54. jumper is on a pin, and the other hole could fit onto a pin if you pulled it
  55. off and re-aligned it.  If you do this, and leave it there for a while, it
  56. shorts out the power connection to the CMOS, casuing it to lose its data.
  57.  
  58. The battery, which, as i said earlier, can be removed to erase CMOS data, is
  59. usually found near the CMOS chip, but not always.  It may look like an over-
  60. size watch battery.  I've seen various other shapes and sizes though.  Some
  61. look like half of a AA battery, some look like 3 small batteries held
  62. together with shrink material, and others look like brown boxes that are not
  63. even mounted on the motherboard, but mounted somewhere else in the case, with
  64. wires running to a pin connector socket on the motherboard (These are replace-
  65. ment batteries for the batteries that are soldered directly to the motherboard
  66. at the factory.  Soldered on batteries are a pain, and clearing the CMOS is
  67. easiest if you find the jumper.
  68.  
  69. Why in the world would you want to clear a CMOS?  Well, for one, if you, or
  70. someone you are working for, happens to forget a startup password, clearing
  71. the CMOS is a viable option.  If you can get into the setup program, write
  72. down all the information (memory size, hard drive specs, floppy specs, and
  73. any other settings there are) before resetting the CMOS.  Of course there are
  74. some other reasons why a hacker would want to be able to do this, but we shall
  75. leave that up to your imagination.
  76.  
  77. Along the way I've come up with a pair of cute little programs in QuickBasic
  78. that will extract CMOS data from a standard AT machine, and to put it back.
  79. I'd imagine you could hex edit the data file it saves, or use a program like
  80. game guru to compare multiple saved CMOS data files.  Who knows, maybe you'll
  81. find a way to do some cool stuff to the data before you put it back into the
  82. CMOS.  This may or may not work on your computer, as there has been a lot
  83. more data stored on the CMOS chips lately.  Call the manufacturer of your
  84. BIOS and they may be able to tell you where the CMOS data is at (and then
  85. you can change the source code respectively).
  86.  
  87. ------------[ HiR CMOS DATA EXTRACTION SOURCE CODE BEGINS HERE ]--------------
  88.  
  89. OPEN "CMOS.DAT" FOR OUTPUT AS #1
  90. FoR CMOSAddress% = 0 TO 63
  91.         OUT &H70, CMOSAddress%
  92.         CMOSByte$ = CHR$(INP(&H71))
  93.         PRINT #1, CMOSByte$
  94. NEXT CMOSAddress%
  95. CLOSE #1
  96. END
  97.                                           
  98. -------------[ HiR CMOS DATA EXTRACTION SOURCE CODE ENDS HERE ]---------------
  99.  
  100. As you can see, the computer will push the CMOS Address to be read into 70h,
  101. then reads the byte from 71h.  Note, since there is only 64 bytes, the program
  102. only pushes addresses 0-63 into 70Hex.  To the best of my knowledge, the CMOS
  103. data will always be read and written using 70h for the address, and 71h for
  104. the data.  The only thing that might change is the number of bytes that the
  105. CMOS Stores.  Find out for sure from your BIOS/CMOS Manufacturer, though, and
  106. make adjustments to the code as nessecary.
  107.  
  108. -------------[ HiR CMOS DATA INSERTION SOURCE CODE BEGINS HERE ]--------------
  109.  
  110.  
  111. OPEN "CMOS.DAT" FOR INPUT AS #1
  112. FoR CMOSAddress% = 0 TO 63
  113.         CMOSByte$ = INPUT$(1,1)
  114.         OUT &H70, CMOSAddress%
  115.         OUT &H71, ASC(CMOSByte$)
  116. NEXT CMOSAddress%
  117. CLOSE #1
  118. END
  119.  
  120. --------------[ HiR CMOS DATA INSERTION SOURCE CODE ENDS HERE ]---------------
  121.  
  122. OBviousely, Both of these programs are just core code, and are by no means
  123. supposed to be used alone, but can be modified a little and combined to make
  124. a fully functional CMOS Backup program, CMOS Data Modification program, and
  125. anything else (Evil or not) that you can think of.  Happy hacking!
  126.